<template>
  <div id="app">
    <header>
      <todoHeader @todoInputValue="todoInputValue"/>
    </header>
    <todoMain
      :propTodo="todoList"
      :propDone="doneList"
      @todoChange="todoChangeValue"
      @doneChange="doneChangeValue"
    />
    <button @click="sendMsg">Bilibili-shop</button>
    <!-- <HelloWorld msg="Welcome to Your Vue.js App"/> -->
  </div>
</template>

<script>
// import HelloWorld from './components/HelloWorld.vue'
import todoHeader from './components/todoHeader.vue'
import todoMain from './components/todoMain.vue'

export default {
  name: 'App',
  components: {
    // HelloWorld,
    todoHeader,
    todoMain
  },
  data () {
    return {
      todoList: [],
      doneList: []
    }
  },
  methods: {
    todoInputValue ({ value }) {
      // console.log(value)
      this.todoList.push(value)
    },
    todoChangeValue (index) {
      this.doneList.push(this.todoList[index])
      this.todoList.splice(index, 1)
    },
    doneChangeValue (index) {
      this.todoList.push(this.doneList[index])
      this.doneList.splice(index, 1)
    },
    sendMsg () {
      this.$http.getBilibiliShop()
        .then(res => {
          console.log(res)
        })
    }
  }
}
</script>

<style lang="scss">
* {
    margin: 0;
    padding: 0;
}

body {
    font-size: 16px;
    background: #CDCDCD;
}
header {
    height: 50px;
    background: #333;
    background: rgba(47,47,47,0.98);
    input {
      float: right;
      width: 60%;
      height: 24px;
      margin-top: 12px;
      text-indent: 10px;
      border-radius: 5px;
      box-shadow: 0 1px 0 rgba(255,255,255,0.24), 0 1px 6px rgba(0,0,0,0.45) inset;
      border: none;
      outline: none;
    }
}
section {
    width: 600px;
    padding: 0 10px;
    margin: 0 auto;
}
h2 {
    display: block;
    font-size: 1.5em;
    margin-block-start: 0.83em;
    margin-block-end: 0.83em;
    margin-inline-start: 0px;
    margin-inline-end: 0px;
    font-weight: bold;
    position: relative;
}
label {
    float: left;
    width: 100px;
    line-height: 50px;
    color: #DDD;
    font-size: 24px;
    cursor: pointer;
    font-family: "Helvetica Neue",Helvetica,Arial,sans-serif;
}
span {
    position: absolute;
    top: 2px;
    right: 5px;
    display: inline-block;
    padding: 0 5px;
    height: 20px;
    border-radius: 20px;
    background: #E6E6FA;
    line-height: 22px;
    text-align: center;
    color: #666;
    font-size: 14px;
}
li {
    height: 32px;
    line-height: 32px;
    background: #fff;
    position: relative;
    margin-bottom: 10px;
    padding: 0 45px;
    border-radius: 3px;
    border-left: 5px solid #629A9C;
    box-shadow: 0 1px 2px rgba(0,0,0,0.07);
    input {
      position: absolute;
      top: 2px;
      left: 10px;
      width: 22px;
      height: 22px;
      cursor: pointer;
    }
    a {
      position: absolute;
      top: 2px;
      right: 5px;
      display: inline-block;
      width: 14px;
      height: 12px;
      border-radius: 14px;
      border: 6px double #FFF;
      background: #CCC;
      line-height: 14px;
      text-align: center;
      color: #FFF;
      font-weight: bold;
      font-size: 14px;
      cursor: pointer;
    }
}
</style>
